import java.util.Enumeration;
import java.util.Vector;
import java.util.Hashtable;
import java.util.Scanner;
public class PackageDemo {
    public static  void main(String [] args){
        double d=11.5;
        float f=11.5f;
        double d2=-11.5;
        System.out.printf("d=%.2f,f=%.2f\n",d,f);
        System.out.printf("Math.ceil(%.2f)=%.2f\n",f,Math.ceil(f));
        System.out.printf("Math.floor(%.2f)=%.2f\n",f,Math.floor(f));
        System.out.printf("Math.ceil(%.2f)=%.2f\n",d,Math.ceil(d));
        System.out.printf("Math.floor(%.2f)=%.2f\n",d,Math.floor(d));
        System.out.printf("Math.abs(%.2f)=%.2f\n",d2,Math.abs(d2));

        Enumeration<String> weekDays;
        Hashtable hash1 = new Hashtable();
        Vector<String> weekDayNames = new Vector<String>();
        weekDayNames.add("星期一:语文");
        weekDayNames.add("星期二:数学");
        weekDayNames.add("星期三:英语");
        weekDayNames.add("星期四:化学");
        weekDayNames.add("星期五:物理");
        weekDayNames.add("星期六:生物");
        weekDayNames.add("星期日:休息");
        weekDays = weekDayNames.elements();
        while(weekDays.hasMoreElements()) {
            System.out.println(weekDays.nextElement());
        }

        hash1.put("语文",new int[1]);
        hash1.put("数学",new int[2]);
        hash1.put("英语",new int[3]);
        hash1.put("化学",new int[4]);
        hash1.put("物理",new int[5]);
        hash1.put("生物",new int[6]);
        hash1.put("休息",new int[7]);
        Enumeration names;
        String str;

        names = hash1.keys();
        while(names.hasMoreElements()) {
            str = names.nextElement().toString();
            System.out.println(str + " : " + hash1.get(str));
        }

        Scanner input = new Scanner(System.in);
        System.out.print("请输入要查找的时间：");
        String key = input.nextLine();

        if (hash1.containsKey(key)) {
            double x =  (Double)hash1.get(key);
            System.out.println("变动之前的人数为：");
            System.out.println(x);

            hash1.put(key,x+500);

            System.out.println("增加500之后的人数为：");
            System.out.println(hash1.get(key));
        }
        else {
            System.out.println("key为："+key+" 的日期未找到！");
        }
        input.close();

    }
}